# Maintainer: Renato Silva <br.renatosilva@gmail.com>

_realname='repman'
pkgname="${_realname}-git"
pkgdesc='Pacman repository manager'
url='https://github.com/renatosilva/repman'
license=(BSD)

arch=(i686 x86_64)
pkgver=r23.87bf865
pkgrel=1

groups=(base)
depends=(pacman)
makedepends=(git)
provides=(${_realname})
conflicts=(${_realname})
source=("git+${url}")
md5sums=(SKIP)

pkgver() {
    cd "${srcdir}/${_realname}"
    printf "r%s.%s" $(git rev-list --count HEAD) $(git rev-parse --short HEAD)
}

build() {
    cd "${srcdir}/${_realname}/native"
    make
}

package() {
    cd "${srcdir}/${_realname}"
    install -Dm755 native/repman.exe        "${pkgdir}/usr/bin/repman.exe"
    install -Dm644 native/inih/LICENSE.txt  "${pkgdir}/usr/share/licenses/${_realname}/inih/LICENSE"
    install -Dm644 LICENSE                  "${pkgdir}/usr/share/licenses/${_realname}/LICENSE"
}
